package com.mrlv.api.dto;

import com.ceway.org.common.utils.validator.ToolInterface;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.*;
import java.io.Serializable;
import java.util.Date;

/**
 * 用户新增dto
 * @author Administrator
 */
@Data
@Accessors(chain = true)
@ApiModel(value="UserSaveDTO", description="用户新增dto")
public class UserSaveDTO implements Serializable {

    @ApiModelProperty(value = "姓名", required = true)
    @NotNull(groups={ToolInterface.insert.class} ,  message = "姓名不能为空")
    private String name;

    @ApiModelProperty(value = "密码", required = true)
    @NotNull(groups={ToolInterface.insert.class}, message = "密码不能为空")
    private String password;

    @ApiModelProperty(value = "手机号码", required = true)
    @Pattern(groups={ToolInterface.insert.class} , regexp = "(?:0|86|\\+86)?1[3-9]\\d{9}", message = "手机号码不正确")
    @NotNull(groups={ToolInterface.insert.class} ,  message = "手机号码不能为空")
    private String mobile;

    @ApiModelProperty(value = "性别  1.男  2.女")
    @Max(groups={ToolInterface.update.class}, value = 2, message = "1或2  1.男  2.女")
    @Min(groups={ToolInterface.update.class}, value = 1, message = "1或2  1.男  2.女")
    private Integer sex;

    @ApiModelProperty(value = "年龄")
    @Min(groups={ToolInterface.update.class}, value = 1, message = "年龄最小值为：1")
    private Integer age;

    @ApiModelProperty(value = "邮箱")
    @Email(message = "邮箱填写不正确")
    private String mail;

    @ApiModelProperty(value = "家庭住址")
    private String homeAddress;

    @ApiModelProperty(value = "学历")
    private String education;

    @ApiModelProperty(value = "身份证号码")
    private String idCard;

    @ApiModelProperty(value = "头像照片")
    private String photo;

    @ApiModelProperty(value = "毕业学校")
    private String graduatedFrom;

    @ApiModelProperty(value = "出生日期")
    @Past
    private Date birthday;
}
